﻿@model IEnumerable<MvcMusicStore.Models.Album>

<script type="text/javascript">
    function DeleteSucces() {
        alert("holass, te borraste uacho");
        return true;
    }
</script>
@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            GenreId
        </th>
        <th>
            Title
        </th>
        <th>
            Price
        </th>
        <th>
            AlbumArtUrl
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.AlbumId }) |
            @Html.ActionLink("Details", "Details", new { id=item.AlbumId }) |
            @Ajax.ActionLink("Delete", "Delete", "Store", new { id = item.AlbumId }, new AjaxOptions { HttpMethod="POST", Confirm = "Borrar?"}, new { })
          </td>
        <td>
            @item.GenreId
        </td>
        <td>
            @item.Title
        </td>
        <td>
            @String.Format("{0:F}", item.Price)
        </td>
        <td>
            @Html.Raw(item.AlbumArtUrl)
        </td>
    </tr>
}

</table>

